﻿using ShuJuGj.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShuJuGj
{
    internal class Dictionaries
    {
        public List<TjTjyyjl> Change(List<TjTjyyjl> tjyyjls)
        {
            var yyjl = tjyyjls;
            for (int i = 0; i < yyjl.Count; i++)
            {
                if (yyjl[i].cardType == "1")
                {
                    yyjl[i].cardType = "身份证";
                }
                else if (yyjl[i].cardType == "2")
                {
                    yyjl[i].cardType = "护照";
                }
                else if (yyjl[i].cardType == "3")
                {
                    yyjl[i].cardType = "台胞证";
                }
                else if (yyjl[i].cardType == "4")
                {
                    yyjl[i].cardType = "港澳通行证";
                }
                else if (yyjl[i].cardType == "5")
                {
                    yyjl[i].cardType = "居民户口簿";
                }
                else if (yyjl[i].cardType == "6")
                {
                    yyjl[i].cardType = "军官证";
                }
                else if (yyjl[i].cardType == "7")
                {
                    yyjl[i].cardType = "驾驶证";
                }
                else if (yyjl[i].cardType == "8")
                {
                    yyjl[i].cardType = "出生医学证明";
                }
                else if (yyjl[i].cardType == "99")
                {
                    yyjl[i].cardType = "其他法定有效证件";
                }

                if (yyjl[i].sexCode == "1")
                {
                    yyjl[i].sexCode = "男";
                }
                else
                {
                    yyjl[i].sexCode = "女";
                }

                if (yyjl[i].married == "1")
                {
                    yyjl[i].married = "未婚";
                }
                else
                {
                    yyjl[i].married = "已婚";
                }

                if (yyjl[i].orderStatus == "1")
                {
                    yyjl[i].orderStatus = "已预约";
                }
                else if (yyjl[i].orderStatus == "2")
                {
                    yyjl[i].orderStatus = "已接收";
                }
                else if (yyjl[i].orderStatus == "3")
                {
                    yyjl[i].orderStatus = "到检";
                }
                else if (yyjl[i].orderStatus == "-1")
                {
                    yyjl[i].orderStatus = "取消预约";
                }

                if (yyjl[i].isPregnant == "true")
                {
                    yyjl[i].isPregnant = "已怀孕";
                }
                else
                {
                    yyjl[i].isPregnant = "未怀孕";
                }

                if (yyjl[i].payType == "1")
                {
                    yyjl[i].payType = "支付宝";
                }
                else
                {
                    yyjl[i].payType = "其他方式";
                }
            }

            return yyjl;
        }
    }
}